//
//  JHHotUserCollectionViewCell.m
//  Liberty Voice
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 ClearLove. All rights reserved.
//

#import "JHHotUserCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@interface JHHotUserCollectionViewCell ()
@property(nonatomic,retain)UIImageView *pic;
@property(nonatomic,retain)UILabel *title;

@end

@implementation JHHotUserCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.pic = [[[UIImageView alloc] init] autorelease];
        [[_pic layer] setBorderWidth:0.8f];
        [self.contentView addSubview:_pic];
        
        self.title = [[[UILabel alloc] init] autorelease];
        _title.textAlignment = 1;
        [self.contentView addSubview:_title];
    }return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _pic.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.height - 40);
    _title.frame = CGRectMake(0, _pic.frame.size.height, _pic.frame.size.width, 40);

}
- (void)setHotUserColl:(JHHotUserColl *)hotUserColl
{
    if (hotUserColl != _hotUserColl) {
        [_hotUserColl release];
        _hotUserColl = [hotUserColl retain];
    }
    [_pic sd_setImageWithURL:[NSURL URLWithString:hotUserColl.smallLogo]];
    _title.text = hotUserColl.nickname;
    
}
@end
